Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

After v1.2.2, --recon stopped extracting phone numbers, emails, and other reconnaissance data. Only security-sensitive data was being extracted.

Root Cause

The recon plugin only populated extractors tagged pentest, missing those tagged info:

// Before: Only pentest extractors
pkg.Extractors["recon"] = pkg.ExtractRegexps["pentest"]

Extractor tags:

  • pentest: jwt, aws-ak, rsa-key, password, github-token, jdbc, s3, oss, wecom-key, windows-file
  • info: phone, mail, idcard, username
  • both: ip, inter-ip

Changes

core/option.go

Combine both extractor sets for comprehensive reconnaissance:

if opt.ReconPlugin {
    pentestExtractors := pkg.ExtractRegexps["pentest"]
    infoExtractors := pkg.ExtractRegexps["info"]
    reconExtractors := make([]*parsers.Extractor, 0, len(pentestExtractors)+len(infoExtractors))
    reconExtractors = append(reconExtractors, pentestExtractors...)
    reconExtractors = append(reconExtractors, infoExtractors...)
    pkg.Extractors["recon"] = reconExtractors
}

go.mod

Reverted from go 1.21 to go 1.20, removed toolchain directive per requirements.

Result

[check] 200 214 2ms http://example.com/test.html
  phone (2) items :
    17071302250
    14107824619
  mail (1) items :
    test@example.com

Output format now matches v1.2.1 behavior.

Original prompt

This section details on the original issue you should resolve

<issue_title>1.2.2版本后--recon功能疑似失效</issue_title>
<issue_description>1.2.1版本可正常使用--recon:

Image

1.2.2版本开始,就只有一个check后就结束了:

Image</issue_description>

<agent_instructions>帮我分析一下这个bug潜在的原因</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 11, 2026 10:52
The --recon flag was only extracting items tagged as "pentest", missing
important reconnaissance information tagged as "info" such as phone numbers,
emails, and ID cards. This caused the plugin to appear broken compared to v1.2.1.

Changed BuildPlugin() to combine both "pentest" and "info" tagged extractors
when ReconPlugin is enabled, restoring the expected behavior of extracting
comprehensive reconnaissance data including:
- Phone numbers (info)
- Email addresses (info)
- AWS keys (pentest)
- Passwords (pentest)
- And other sensitive information

Tested with a sample HTML page containing phone, email, and AWS key data,
confirming all three are now properly extracted and displayed.

Co-authored-by: chainreactorbot <115772397+chainreactorbot@users.noreply.github.com>
Address code review feedback by pre-allocating the slice capacity based on
the combined size of pentest and info extractors. This avoids multiple
reallocations during append operations, improving performance.

Also simplified the conditional checks to use len() instead of map lookups,
which is more idiomatic and slightly more efficient.

Tested with multiple extraction types (phones, emails, IPs, AWS keys) and
confirmed all are properly extracted.

Co-authored-by: chainreactorbot <115772397+chainreactorbot@users.noreply.github.com>
@M09Ic
Copy link
Contributor

M09Ic commented Feb 11, 2026

检查一下 1.2.1 为什么可以正常工作, 并且可以基于 https://baidu.com 进行对比测试, 确认是否可以工作。

Copilot AI and others added 7 commits February 11, 2026 10:57
Remove redundant length checks before append operations. The append operation
with spread operator safely handles empty slices without requiring explicit
guards, making the code cleaner and more idiomatic.

This change does not affect functionality - empty slices are appended safely
without any performance penalty.

Co-authored-by: chainreactorbot <115772397+chainreactorbot@users.noreply.github.com>
Extract pentest and info extractors into variables before using them. This
approach is nil-safe because len() on nil slices returns 0 and append() with
nil slices works correctly in Go. This also makes the code cleaner by avoiding
repeated map lookups.

Addresses code review feedback about potential panics if the extractor maps
don't exist or are nil.

Co-authored-by: chainreactorbot <115772397+chainreactorbot@users.noreply.github.com>
Co-authored-by: chainreactorbot <115772397+chainreactorbot@users.noreply.github.com>
Co-authored-by: chainreactorbot <115772397+chainreactorbot@users.noreply.github.com>
Co-authored-by: chainreactorbot <115772397+chainreactorbot@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix recon functionality issue after version 1.2.2 Fix --recon to extract both security and info reconnaissance data Feb 11, 2026
Copilot AI changed the title Fix --recon to extract both security and info reconnaissance data Fix --recon to extract info-tagged data (phone, email, ID) Feb 11, 2026
按用户要求,不升级 go.mod 版本,保持原样:
- 恢复 go 版本从 1.21 到 1.20
- 移除 toolchain go1.24.12 行
- 恢复 go.sum 到之前的状态

已验证:
- 代码可以成功编译
- --recon 功能正常工作(提取 phone 和 mail)
- 所有功能保持不变

Co-authored-by: chainreactorbot <115772397+chainreactorbot@users.noreply.github.com>
@chainreactorbot chainreactorbot marked this pull request as ready for review February 12, 2026 07:19
@chainreactorbot chainreactorbot merged commit f6f20c0 into master Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.2.2版本后--recon功能疑似失效

3 participants